
/**
 * This is a generated class and is not intended for modification.  
 */
package com.model.valueObjects
{
import com.adobe.fiber.styles.IStyle;
import com.adobe.fiber.styles.Style;
import com.adobe.fiber.styles.StyleValidator;
import com.adobe.fiber.valueobjects.AbstractEntityMetadata;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import mx.events.ValidationResultEvent;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IModelType;
import mx.events.PropertyChangeEvent;

use namespace model_internal;

[ExcludeClass]
internal class _VoMarkupHeaderEntityMetadata extends com.adobe.fiber.valueobjects.AbstractEntityMetadata
{
    private static var emptyArray:Array = new Array();

    model_internal static var allProperties:Array = new Array("cre_datetime", "markup_remark", "markup_value", "priceE", "priceF", "serialnumber", "priceC", "markup_code", "priceD", "priceA", "priceB", "cre_userid", "markup_type", "activestatus");
    model_internal static var allAssociationProperties:Array = new Array();
    model_internal static var allRequiredProperties:Array = new Array("cre_datetime", "markup_remark", "markup_value", "priceE", "priceF", "serialnumber", "priceC", "markup_code", "priceD", "priceA", "priceB", "cre_userid", "markup_type", "activestatus");
    model_internal static var allAlwaysAvailableProperties:Array = new Array("cre_datetime", "markup_remark", "markup_value", "priceE", "priceF", "serialnumber", "priceC", "markup_code", "priceD", "priceA", "priceB", "cre_userid", "markup_type", "activestatus");
    model_internal static var guardedProperties:Array = new Array();
    model_internal static var dataProperties:Array = new Array("cre_datetime", "markup_remark", "markup_value", "priceE", "priceF", "serialnumber", "priceC", "markup_code", "priceD", "priceA", "priceB", "cre_userid", "markup_type", "activestatus");
    model_internal static var derivedProperties:Array = new Array();
    model_internal static var collectionProperties:Array = new Array();
    model_internal static var collectionBaseMap:Object;
    model_internal static var entityName:String = "VoMarkupHeader";
    model_internal static var dependentsOnMap:Object;
    model_internal static var dependedOnServices:Array = new Array();

    
    model_internal var _cre_datetimeIsValid:Boolean;
    model_internal var _cre_datetimeValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _cre_datetimeIsValidCacheInitialized:Boolean = false;
    model_internal var _cre_datetimeValidationFailureMessages:Array;
    
    model_internal var _markup_remarkIsValid:Boolean;
    model_internal var _markup_remarkValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _markup_remarkIsValidCacheInitialized:Boolean = false;
    model_internal var _markup_remarkValidationFailureMessages:Array;
    
    model_internal var _markup_valueIsValid:Boolean;
    model_internal var _markup_valueValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _markup_valueIsValidCacheInitialized:Boolean = false;
    model_internal var _markup_valueValidationFailureMessages:Array;
    
    model_internal var _markup_codeIsValid:Boolean;
    model_internal var _markup_codeValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _markup_codeIsValidCacheInitialized:Boolean = false;
    model_internal var _markup_codeValidationFailureMessages:Array;
    
    model_internal var _markup_typeIsValid:Boolean;
    model_internal var _markup_typeValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _markup_typeIsValidCacheInitialized:Boolean = false;
    model_internal var _markup_typeValidationFailureMessages:Array;

    model_internal var _instance:_Super_VoMarkupHeader;
    model_internal static var _nullStyle:com.adobe.fiber.styles.Style = new com.adobe.fiber.styles.Style();

    public function _VoMarkupHeaderEntityMetadata(value : _Super_VoMarkupHeader)
    {
        // initialize property maps
        if (model_internal::dependentsOnMap == null)
        {
            // depenents map
            model_internal::dependentsOnMap = new Object();
            model_internal::dependentsOnMap["cre_datetime"] = new Array();
            model_internal::dependentsOnMap["markup_remark"] = new Array();
            model_internal::dependentsOnMap["markup_value"] = new Array();
            model_internal::dependentsOnMap["priceE"] = new Array();
            model_internal::dependentsOnMap["priceF"] = new Array();
            model_internal::dependentsOnMap["serialnumber"] = new Array();
            model_internal::dependentsOnMap["priceC"] = new Array();
            model_internal::dependentsOnMap["markup_code"] = new Array();
            model_internal::dependentsOnMap["priceD"] = new Array();
            model_internal::dependentsOnMap["priceA"] = new Array();
            model_internal::dependentsOnMap["priceB"] = new Array();
            model_internal::dependentsOnMap["cre_userid"] = new Array();
            model_internal::dependentsOnMap["markup_type"] = new Array();
            model_internal::dependentsOnMap["activestatus"] = new Array();

            // collection base map
            model_internal::collectionBaseMap = new Object()
        }

        model_internal::_instance = value;
        model_internal::_cre_datetimeValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCre_datetime);
        model_internal::_cre_datetimeValidator.required = true;
        model_internal::_cre_datetimeValidator.requiredFieldError = "cre_datetime is required";
        //model_internal::_cre_datetimeValidator.source = model_internal::_instance;
        //model_internal::_cre_datetimeValidator.property = "cre_datetime";
        model_internal::_markup_remarkValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForMarkup_remark);
        model_internal::_markup_remarkValidator.required = true;
        model_internal::_markup_remarkValidator.requiredFieldError = "markup_remark is required";
        //model_internal::_markup_remarkValidator.source = model_internal::_instance;
        //model_internal::_markup_remarkValidator.property = "markup_remark";
        model_internal::_markup_valueValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForMarkup_value);
        model_internal::_markup_valueValidator.required = true;
        model_internal::_markup_valueValidator.requiredFieldError = "markup_value is required";
        //model_internal::_markup_valueValidator.source = model_internal::_instance;
        //model_internal::_markup_valueValidator.property = "markup_value";
        model_internal::_markup_codeValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForMarkup_code);
        model_internal::_markup_codeValidator.required = true;
        model_internal::_markup_codeValidator.requiredFieldError = "markup_code is required";
        //model_internal::_markup_codeValidator.source = model_internal::_instance;
        //model_internal::_markup_codeValidator.property = "markup_code";
        model_internal::_markup_typeValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForMarkup_type);
        model_internal::_markup_typeValidator.required = true;
        model_internal::_markup_typeValidator.requiredFieldError = "markup_type is required";
        //model_internal::_markup_typeValidator.source = model_internal::_instance;
        //model_internal::_markup_typeValidator.property = "markup_type";
    }

    override public function getEntityName():String
    {
        return model_internal::entityName;
    }

    override public function getProperties():Array
    {
        return model_internal::allProperties;
    }

    override public function getAssociationProperties():Array
    {
        return model_internal::allAssociationProperties;
    }

    override public function getRequiredProperties():Array
    {
         return model_internal::allRequiredProperties;   
    }

    override public function getDataProperties():Array
    {
        return model_internal::dataProperties;
    }

    override public function getGuardedProperties():Array
    {
        return model_internal::guardedProperties;
    }

    override public function getUnguardedProperties():Array
    {
        return model_internal::allAlwaysAvailableProperties;
    }

    override public function getDependants(propertyName:String):Array
    {
       if (model_internal::dataProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a data property of entity VoMarkupHeader");  
            
       return model_internal::dependentsOnMap[propertyName] as Array;  
    }

    override public function getDependedOnServices():Array
    {
        return model_internal::dependedOnServices;
    }

    override public function getCollectionProperties():Array
    {
        return model_internal::collectionProperties;
    }

    override public function getCollectionBase(propertyName:String):String
    {
        if (model_internal::collectionProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a collection property of entity VoMarkupHeader");  

        return model_internal::collectionBaseMap[propertyName];
    }

    override public function getAvailableProperties():com.adobe.fiber.valueobjects.IPropertyIterator
    {
        return new com.adobe.fiber.valueobjects.AvailablePropertyIterator(this);
    }

    override public function getValue(propertyName:String):*
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity VoMarkupHeader");
        }

        return model_internal::_instance[propertyName];
    }

    override public function setValue(propertyName:String, value:*):void
    {
        if (model_internal::dataProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " is not a data property of entity VoMarkupHeader");
        }

        model_internal::_instance[propertyName] = value;
    }

    override public function getMappedByProperty(associationProperty:String):String
    {
        switch(associationProperty)
        {
            default:
            {
                return null;
            }
        }
    }

    override public function getPropertyLength(propertyName:String):int
    {
        switch(propertyName)
        {
            default:
            {
                return 0;
            }
        }
    }

    override public function isAvailable(propertyName:String):Boolean
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity VoMarkupHeader");
        }

        if (model_internal::allAlwaysAvailableProperties.indexOf(propertyName) != -1)
        {
            return true;
        }

        switch(propertyName)
        {
            default:
            {
                return true;
            }
        }
    }

    override public function getIdentityMap():Object
    {
        var returnMap:Object = new Object();

        return returnMap;
    }

    [Bindable(event="propertyChange")]
    override public function get invalidConstraints():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_invalidConstraints;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_invalidConstraints;        
        }
    }

    [Bindable(event="propertyChange")]
    override public function get validationFailureMessages():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
    }

    override public function getDependantInvalidConstraints(propertyName:String):Array
    {
        var dependants:Array = getDependants(propertyName);
        if (dependants.length == 0)
        {
            return emptyArray;
        }

        var currentlyInvalid:Array = invalidConstraints;
        if (currentlyInvalid.length == 0)
        {
            return emptyArray;
        }

        var filterFunc:Function = function(element:*, index:int, arr:Array):Boolean
        {
            return dependants.indexOf(element) > -1;
        }

        return currentlyInvalid.filter(filterFunc);
    }

    /**
     * isValid
     */
    [Bindable(event="propertyChange")] 
    public function get isValid() : Boolean
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_isValid;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_isValid;
        }
    }

    [Bindable(event="propertyChange")]
    public function get isCre_datetimeAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isMarkup_remarkAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isMarkup_valueAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPriceEAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPriceFAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isSerialnumberAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPriceCAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isMarkup_codeAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPriceDAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPriceAAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPriceBAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isCre_useridAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isMarkup_typeAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isActivestatusAvailable():Boolean
    {
        return true;
    }


    /**
     * derived property recalculation
     */
    public function invalidateDependentOnCre_datetime():void
    {
        if (model_internal::_cre_datetimeIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCre_datetime = null;
            model_internal::calculateCre_datetimeIsValid();
        }
    }
    public function invalidateDependentOnMarkup_remark():void
    {
        if (model_internal::_markup_remarkIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfMarkup_remark = null;
            model_internal::calculateMarkup_remarkIsValid();
        }
    }
    public function invalidateDependentOnMarkup_value():void
    {
        if (model_internal::_markup_valueIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfMarkup_value = null;
            model_internal::calculateMarkup_valueIsValid();
        }
    }
    public function invalidateDependentOnMarkup_code():void
    {
        if (model_internal::_markup_codeIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfMarkup_code = null;
            model_internal::calculateMarkup_codeIsValid();
        }
    }
    public function invalidateDependentOnMarkup_type():void
    {
        if (model_internal::_markup_typeIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfMarkup_type = null;
            model_internal::calculateMarkup_typeIsValid();
        }
    }

    model_internal function fireChangeEvent(propertyName:String, oldValue:Object, newValue:Object):void
    {
        this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, propertyName, oldValue, newValue));
    }

    [Bindable(event="propertyChange")]   
    public function get cre_datetimeStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get cre_datetimeValidator() : StyleValidator
    {
        return model_internal::_cre_datetimeValidator;
    }

    model_internal function set _cre_datetimeIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_cre_datetimeIsValid;         
        if (oldValue !== value)
        {
            model_internal::_cre_datetimeIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cre_datetimeIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get cre_datetimeIsValid():Boolean
    {
        if (!model_internal::_cre_datetimeIsValidCacheInitialized)
        {
            model_internal::calculateCre_datetimeIsValid();
        }

        return model_internal::_cre_datetimeIsValid;
    }

    model_internal function calculateCre_datetimeIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_cre_datetimeValidator.validate(model_internal::_instance.cre_datetime)
        model_internal::_cre_datetimeIsValid_der = (valRes.results == null);
        model_internal::_cre_datetimeIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::cre_datetimeValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::cre_datetimeValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get cre_datetimeValidationFailureMessages():Array
    {
        if (model_internal::_cre_datetimeValidationFailureMessages == null)
            model_internal::calculateCre_datetimeIsValid();

        return _cre_datetimeValidationFailureMessages;
    }

    model_internal function set cre_datetimeValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_cre_datetimeValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_cre_datetimeValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cre_datetimeValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get markup_remarkStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get markup_remarkValidator() : StyleValidator
    {
        return model_internal::_markup_remarkValidator;
    }

    model_internal function set _markup_remarkIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_markup_remarkIsValid;         
        if (oldValue !== value)
        {
            model_internal::_markup_remarkIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "markup_remarkIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get markup_remarkIsValid():Boolean
    {
        if (!model_internal::_markup_remarkIsValidCacheInitialized)
        {
            model_internal::calculateMarkup_remarkIsValid();
        }

        return model_internal::_markup_remarkIsValid;
    }

    model_internal function calculateMarkup_remarkIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_markup_remarkValidator.validate(model_internal::_instance.markup_remark)
        model_internal::_markup_remarkIsValid_der = (valRes.results == null);
        model_internal::_markup_remarkIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::markup_remarkValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::markup_remarkValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get markup_remarkValidationFailureMessages():Array
    {
        if (model_internal::_markup_remarkValidationFailureMessages == null)
            model_internal::calculateMarkup_remarkIsValid();

        return _markup_remarkValidationFailureMessages;
    }

    model_internal function set markup_remarkValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_markup_remarkValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_markup_remarkValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "markup_remarkValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get markup_valueStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get markup_valueValidator() : StyleValidator
    {
        return model_internal::_markup_valueValidator;
    }

    model_internal function set _markup_valueIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_markup_valueIsValid;         
        if (oldValue !== value)
        {
            model_internal::_markup_valueIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "markup_valueIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get markup_valueIsValid():Boolean
    {
        if (!model_internal::_markup_valueIsValidCacheInitialized)
        {
            model_internal::calculateMarkup_valueIsValid();
        }

        return model_internal::_markup_valueIsValid;
    }

    model_internal function calculateMarkup_valueIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_markup_valueValidator.validate(model_internal::_instance.markup_value)
        model_internal::_markup_valueIsValid_der = (valRes.results == null);
        model_internal::_markup_valueIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::markup_valueValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::markup_valueValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get markup_valueValidationFailureMessages():Array
    {
        if (model_internal::_markup_valueValidationFailureMessages == null)
            model_internal::calculateMarkup_valueIsValid();

        return _markup_valueValidationFailureMessages;
    }

    model_internal function set markup_valueValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_markup_valueValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_markup_valueValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "markup_valueValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get priceEStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get priceFStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get serialnumberStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get priceCStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get markup_codeStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get markup_codeValidator() : StyleValidator
    {
        return model_internal::_markup_codeValidator;
    }

    model_internal function set _markup_codeIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_markup_codeIsValid;         
        if (oldValue !== value)
        {
            model_internal::_markup_codeIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "markup_codeIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get markup_codeIsValid():Boolean
    {
        if (!model_internal::_markup_codeIsValidCacheInitialized)
        {
            model_internal::calculateMarkup_codeIsValid();
        }

        return model_internal::_markup_codeIsValid;
    }

    model_internal function calculateMarkup_codeIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_markup_codeValidator.validate(model_internal::_instance.markup_code)
        model_internal::_markup_codeIsValid_der = (valRes.results == null);
        model_internal::_markup_codeIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::markup_codeValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::markup_codeValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get markup_codeValidationFailureMessages():Array
    {
        if (model_internal::_markup_codeValidationFailureMessages == null)
            model_internal::calculateMarkup_codeIsValid();

        return _markup_codeValidationFailureMessages;
    }

    model_internal function set markup_codeValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_markup_codeValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_markup_codeValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "markup_codeValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get priceDStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get priceAStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get priceBStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get cre_useridStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get markup_typeStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get markup_typeValidator() : StyleValidator
    {
        return model_internal::_markup_typeValidator;
    }

    model_internal function set _markup_typeIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_markup_typeIsValid;         
        if (oldValue !== value)
        {
            model_internal::_markup_typeIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "markup_typeIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get markup_typeIsValid():Boolean
    {
        if (!model_internal::_markup_typeIsValidCacheInitialized)
        {
            model_internal::calculateMarkup_typeIsValid();
        }

        return model_internal::_markup_typeIsValid;
    }

    model_internal function calculateMarkup_typeIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_markup_typeValidator.validate(model_internal::_instance.markup_type)
        model_internal::_markup_typeIsValid_der = (valRes.results == null);
        model_internal::_markup_typeIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::markup_typeValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::markup_typeValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get markup_typeValidationFailureMessages():Array
    {
        if (model_internal::_markup_typeValidationFailureMessages == null)
            model_internal::calculateMarkup_typeIsValid();

        return _markup_typeValidationFailureMessages;
    }

    model_internal function set markup_typeValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_markup_typeValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_markup_typeValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "markup_typeValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get activestatusStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }


     /**
     * 
     * @inheritDoc 
     */ 
     override public function getStyle(propertyName:String):com.adobe.fiber.styles.IStyle
     {
         switch(propertyName)
         {
            default:
            {
                return null;
            }
         }
     }
     
     /**
     * 
     * @inheritDoc 
     *  
     */  
     override public function getPropertyValidationFailureMessages(propertyName:String):Array
     {
         switch(propertyName)
         {
            case("cre_datetime"):
            {
                return cre_datetimeValidationFailureMessages;
            }
            case("markup_remark"):
            {
                return markup_remarkValidationFailureMessages;
            }
            case("markup_value"):
            {
                return markup_valueValidationFailureMessages;
            }
            case("markup_code"):
            {
                return markup_codeValidationFailureMessages;
            }
            case("markup_type"):
            {
                return markup_typeValidationFailureMessages;
            }
            default:
            {
                return emptyArray;
            }
         }
     }

}

}
